DEF TR_MAX_NAME_LEN = 64

# STreeCtrl 常量
STVI_ROOT = 0xFFFF0000
STVI_FIRST = 0xFFFF0001
STVI_LAST = 0xFFFF0002	#=TVI_LAST

STVN_ROOT = 0xFFFF0000	#=STVN_ROOT
STVN_FIRST = 0xFFFF0001	#=STVN_FIRST
STVN_LAST = 0xFFFF0002	#=STVN_LAST
STVL_ROOT = 0xFFFF0000

TVE_COLLAPSE = 0x0001
TVE_EXPAND = 0x0002
TVE_TOGGLE = 0x0003

TVC_COLLAPSE = 0x0001
TVC_EXPAND = 0x0002
TVC_TOGGLE = 0x0003

RECONTENT_CARET = 4294967294 #内容插入在光标(2^32-1)
RECONTENT_LAST = 4294967295 #内容插入在结尾(2^32-2)

E_NOINTERFACE = 0x80004002L

RES_PE = 0
RES_FILE = 1

class Event:
    EVT_INIT = 8000
    EVT_EXIT = 8001
    EVT_TIMER = 8002
    EVT_GET_CARET = 8003

    #基本窗口事件
    EVT_SETFOCUS = 8100
    EVT_KILLFOCUS = 8101
    EVT_CREATE = 8102
    EVT_INIT_FINISH = 8103
    EVT_DESTROY = 8104
    EVT_SIZE = 8105
    EVT_VISIBLECHANGED = 8106
    EVT_STATECHANGED = 8107
    EVT_CAPTURECHANGED = 8108
    EVT_MOUSE_CLICK = 8109
    EVT_UPDATE_TOOLTIP = 8110
    EVT_ANIMATION_START = 8111
    EVT_ANIMATION_STOP = 8112
    EVT_ANIMATION_REPEAT = 8113
    EVT_POS = 8114

    EVT_KEYDOWN = 8200

    #两个窗口鼠标状态事件
    EVT_MOUSE_HOVER = 9000
    EVT_MOUSE_LEAVE = 9001

    EVT_CMD = 10000
    EVT_MENU_CMD = 10001
    EVT_CTXMENU = 10002

    #增加两个滚动VIEW的事件
    EVT_SCROLLVIEW_ORIGINCHANGED = 10003
    EVT_SCROLLVIEW_SIZECHANGED = 10004

    EVT_SCROLL = 10005
    EVT_OFEVENT = 10006    #消息二次包装
    EVT_OFPANEL = 10007    #一个itemPanel中的消息的二次包装

    #增加4个itempanel相关的事件,经过EVT_OFPANEL到达应用层
    EVT_ITEMPANEL_CLICK = 10008
    EVT_ITEMPANEL_RCLICK = 10009
    EVT_ITEMPANEL_CLICK_UP = 10010
    EVT_ITEMPANEL_RCLICK_UP = 10011
    EVT_ITEMPANEL_DBCLICK = 10012
    EVT_ITEMPANEL_HOVER = 10013
    EVT_ITEMPANEL_LEAVE = 10014

    EVT_RADIOGROUP_CHECK_CHANGED = 10100

    EVT_TAB_SELCHANGING = 11000
    EVT_TAB_SELCHANGED = 11001
    EVT_TAB_ITEMHOVER = 11002
    EVT_TAB_ITEMLEAVE = 11003

    EVT_LB_SELCHANGING = 12000
    EVT_LB_SELCHANGED = 12001
    EVT_LB_DBCLICK = 12002

    EVT_LC_SELCHANGING = 13000
    EVT_LC_SELCHANGED = 13001
    EVT_LC_ITEMDELETED = 13002
    EVT_LC_DBCLICK = 13003

    EVT_TV_SELCHANGING = 14000
    EVT_TV_SELCHANGED = 14001

    EVT_TC_SELCHANGING = 15000
    EVT_TC_SELCHANGED = 15001
    EVT_TC_EXPAND = 15002
    EVT_TC_CHECKSTATE = 15003
    EVT_TC_DBCLICK = 15004
    EVT_CB_BEFORE_CLOSEUP = 15005

    EVT_LV_SELCHANGING = 15100
    EVT_LV_SELCHANGED = 15101
    EVT_LV_ITEMCLICK = 15102

    EVT_RE_NOTIFY = 16000
    EVT_RE_MENU = 16001

    EVT_SLIDER_POS = 17000
    EVT_SLIDER_VALUETIP = 17001

    EVT_HEADER_CLICK = 18000
    EVT_HEADER_ITEMCHANGING = 18001
    EVT_HEADER_ITEMCHANGED = 18002
    EVT_HEADER_ITEMSWAP = 18003
    EVT_HEADER_RELAYOUT = 18004

    EVT_CB_SELCHANGE = 19000
    EVT_CB_DROPDOWN = 19001

    EVT_CALENDAR_SELDAY = 20000
    EVT_CALENDAR_SETDATE = 20001
    EVT_CALENDAREX_CHANGED = 20002
    EVT_DATETIME_CHANGED = 20003

    EVT_SPIN_VALUE2STRING = 21000

    EVT_SPLIT_PANE_MOVED = 22000

    EVT_HOT_KEY_SET = 23000

    #图片动画开始，结束事件
    EVT_IMAGE_ANI_START = 22100
    EVT_IMAGE_ANI_STOP = 22101
    EVT_IMAGE_ANI_REPEAT = 22102

    EVT_SELECTMENU = 22150
    EVT_POPMENU = 22151

    EVT_REALWND_CREATE = 22160
    EVT_REALWND_DESTROY = 22161
    EVT_REALWND_INIT = 22162
    EVT_REALWND_POSITION = 22163

    EVT_EXTERNAL_BEGIN = 10000000
    
    EVT_CAPTURE = 10000100
    EVT_CAPTURE_FINISH = 10000101
    
    EVT_SWITCH_CHANGED = 10000800

class MB:
    MB_OK = 0x00000000
    MB_OKCANCEL = 0x00000001
    MB_ABORTRETRYIGNORE = 0x00000002
    MB_YESNOCANCEL = 0x00000003
    MB_YESNO = 0x00000004
    MB_RETRYCANCEL = 0x00000005
    #if(WINVER >= 0x0500)
    MB_CANCELTRYCONTINUE = 0x00000006
    #endif /* WINVER >= 0x0500 */

    MB_ICONHAND = 0x00000010
    MB_ICONQUESTION = 0x00000020
    MB_ICONEXCLAMATION = 0x00000030
    MB_ICONASTERISK = 0x00000040

    #if(WINVER >= 0x0400)
    MB_USERICON = 0x00000080
    MB_ICONWARNING = MB_ICONEXCLAMATION
    MB_ICONERROR = MB_ICONHAND
    #endif /* WINVER >= 0x0400 */

    MB_ICONINFORMATION = MB_ICONASTERISK
    MB_ICONSTOP = MB_ICONHAND

    MB_DEFBUTTON1 = 0x00000000
    MB_DEFBUTTON2 = 0x00000100
    MB_DEFBUTTON3 = 0x00000200
    #if(WINVER >= 0x0400)
    MB_DEFBUTTON4 = 0x00000300
    #endif /* WINVER >= 0x0400 */

    MB_APPLMODAL = 0x00000000
    MB_SYSTEMMODAL = 0x00001000
    MB_TASKMODAL = 0x00002000
    #if(WINVER >= 0x0400)
    MB_HELP = 0x00004000 #// Help Button
    #endif /* WINVER >= 0x0400 */

    MB_NOFOCUS = 0x00008000
    MB_SETFOREGROUND = 0x00010000
    MB_DEFAULT_DESKTOP_ONLY = 0x00020000

    #if(WINVER >= 0x0400)
    MB_TOPMOST = 0x00040000
    MB_RIGHT = 0x00080000
    MB_RTLREADING = 0x00100000

    #endif /* WINVER >= 0x0400 */

    #ifdef _WIN32_WINNT
    #if (_WIN32_WINNT >= 0x0400)
    MB_SERVICE_NOTIFICATION = 0x00200000

    MB_SERVICE_NOTIFICATION_NT3X = 0x00040000
    #endif

    MB_TYPEMASK = 0x0000000F
    MB_ICONMASK = 0x000000F0
    MB_DEFMASK = 0x00000F00
    MB_MODEMASK = 0x00003000
    MB_MISCMASK = 0x0000C000
    
class DialogID:
    IDOK = 1
    IDCANCEL = 2
    IDABORT = 3
    IDRETRY = 4
    IDIGNORE = 5
    IDYES = 6
    IDNO = 7
    #if(WINVER >= 0x0400)
    IDCLOSE = 8
    IDHELP = 9
    #endif /* WINVER >= 0x0400 */

    #if(WINVER >= 0x0500)
    IDTRYAGAIN = 10
    IDCONTINUE = 11
    #endif /* WINVER >= 0x0500 */

    #if(WINVER >= 0x0501)
    #ifndef IDTIMEOUT
    IDTIMEOUT = 32000
    #endif
    #endif /* WINVER >= 0x0501 */

class SingletonType:
    SINGLETON_UIDEF = 0
    SINGLETON_SWNDMGR = 1
    SINGLETON_TIMERGENERATOR = 2
    SINGLETON_FONTPOOL = 3
    SINGLETON_STYLEPOOLMGR = 4
    SINGLETON_TEMPLATEPOOLMGR = 5
    SINGLETON_SKINPOOLMGR = 6
    SINGLETON_WINDOWFINDER = 7
    SINGLETON_TEXTSERVICEHELPER = 8
    SINGLETON_RICHEDITMENUDEF = 9
    SINGLETON_SIMPLEWNDHELPER = 10
    SINGLETON_HOSTMGR = 11
    SINGLETON_NOTIFYCENTER = 12
    SINGLETON_COUNT = 13

class SObjectType:
    None_ = -1
    Undef = 0
    NativeWnd = 1
    Window = 2
    Skin = 3
    Layout = 4
    Event = 5
    Interpolator = 6
    Animation = 7
    ValueAnimator = 8
    UserType = 9

Singleton_OBJS = {
    SingletonType.SINGLETON_NOTIFYCENTER: SNotifyCenter
}

class XmlEncoding:
    enc_auto = 0
    enc_utf8 = 1
    enc_utf16_le = 2
    enc_utf16_be = 3
    enc_utf16 = 4
    enc_utf32_le = 5
    enc_utf32_be = 6
    enc_utf32 = 7
    enc_wchar = 8
    enc_latin1 = 9
    enc_bin = 10

class XmlParseOpt:
    xml_parse_minimal = 0x0000
    xml_parse_pi = 0x0001
    xml_parse_comments = 0x0002
    xml_parse_cdata = 0x0004
    xml_parse_ws_pcdata = 0x0008
    xml_parse_escapes = 0x0010
    xml_parse_eol = 0x0020
    xml_parse_wconv_attribute = 0x0040
    xml_parse_wnorm_attribute = 0x0080
    xml_parse_declaration = 0x0100
    xml_parse_doctype = 0x0200
    xml_parse_ws_pcdata_single = 0x0400
    xml_parse_trim_pcdata = 0x0800
    xml_parse_fragment = 0x1000
    xml_parse_embed_pcdata = 0x2000
    xml_parse_default = xml_parse_cdata | xml_parse_escapes | xml_parse_wconv_attribute | xml_parse_eol
    xml_parse_full = xml_parse_default | xml_parse_pi | xml_parse_comments | xml_parse_declaration | xml_parse_doctype
